package ru.yermak.bookkeeping.ui;

/**
 * User: harrier
 * Date: Aug 6, 2008
 */

import java.awt.Component;
import java.util.List;
import javax.swing.*;

public class  BoxLayoutPanel extends JPanel {
    /**
     * We can't use "components" as the property name,
     * because it conflicts with an existing property
     * on the Component superclass.
     */
    private List panelComponents;
    private int axis;

    public void setAxis(int axis) {
        this.axis = axis;
    }

    public void setPanelComponents(List panelComponents) {
        this.panelComponents = panelComponents;
    }

    public void init() {
        setLayout(new BoxLayout(this, axis));
        for (Object panelComponent : panelComponents) {
            add((Component) panelComponent);
        }
    }
}
